package com.o.mj.controller;

import com.o.mj.dao.WorkPersonMapper;
import com.o.mj.pojo.UserInfo;
import com.o.mj.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.File;
import java.io.IOException;

@Controller
public class BaseTextController {

    @Autowired
    RedisService redisService;

    @RequestMapping("/s")
    public String L(Model model){return "pages_login";}

    @RequestMapping("/w")
    public String J(Model model){
        String ak="a23";
        model.addAttribute("ak",ak);
        return "/index";
    }

    @RequestMapping("/xxx/{sId}")
    @ResponseBody
    public UserInfo xxx(@PathVariable(value = "sId", required = false) String userId){
        UserInfo userInfo = redisService.find(userId);
        return userInfo;
    }

    @RequestMapping("/e")
    public void test1() {


        String filePath = "f://mingw//a.jpg";


        File file = new File(filePath);


        if (!file.exists()) {


            file.mkdirs();


            System.out.println("执行完了啊");
        }
    }


    @RequestMapping("/el")
    public void main(){
        int i=0;
        int a[]={1,2,3,4,5,6,7,8,9,10};
        for (i=0;i<=10;i++){
            a[i]=0;
            System.out.println("he");
        }
    }
}


